<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Hash;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class IndentController extends Controller
{
    /**
     * 后台订单列表
     */
    public function getIndex(Request $request)
    {
        //获取用户id
        $indents = DB::select('select * from indent');
        //解析模板  分配变量
        return view('indent.index',['indents'=>$indents,'request'=>$request->all()]);
    }

   
    /**
     * ajax删除订单
     */
    public function postDelete(Request $request)
    {
        $id = $request->input('id');
        //执行数据删除
        $res = DB::table('indent')->where('id',$id)->delete();
        //判断返回
        if($res){
            echo 1;
        }else{
            echo 0;
        }
    }

}
